package view.rules;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

import net.miginfocom.swing.MigLayout;

public class RuleTypePanel extends JPanel{
	
	ButtonGroup RButtonGroup;
	private JPanel ruleTypePanel;
	public JRadioButton simpleRButton;
	public JRadioButton tableRButton;
	public JRadioButton morphoRButton;
	public JRadioButton formSelectRButton;
	public JRadioButton phraseBuildRButton;
	
	public RuleTypePanel(){
		setLayout(new MigLayout());
		initComponent();
		addComponent();
	}
	
	private void initComponent(){
		
		ruleTypePanel = new JPanel();
		ruleTypePanel.setBorder(BorderFactory.createTitledBorder("Type of Rule"));
		
		simpleRButton = new JRadioButton("Simple");
		tableRButton = new JRadioButton("Table");
		morphoRButton = new JRadioButton("Morphophonemic");
		formSelectRButton = new JRadioButton("Form Selection");
		phraseBuildRButton = new JRadioButton("Phrase Builder");
		
		RButtonGroup = new ButtonGroup();
		RButtonGroup.add(simpleRButton);
		RButtonGroup.add(tableRButton);
		RButtonGroup.add(morphoRButton);
		RButtonGroup.add(formSelectRButton);
		RButtonGroup.add(phraseBuildRButton);
		
	}
	
	private void addComponent(){
		
		addRuleType();
		add(ruleTypePanel);
		
	}

	private void addRuleType() {
		
		ruleTypePanel.add(simpleRButton);
		ruleTypePanel.add(tableRButton);
		ruleTypePanel.add(morphoRButton);
		ruleTypePanel.add(formSelectRButton);
		ruleTypePanel.add(phraseBuildRButton);
		
	}

}
